package ClassData;

import ClassData.Visitor.IVisitor;
import ClassData.Visitor.IVisitorElement;

public class ConstantPool implements IVisitorElement {

	ConstantPoolInfo [] myConstantPool;
	
	public ConstantPool(int size) {
		myConstantPool=new	ConstantPoolInfo[size];
	}

	public void set(int position,ConstantPoolInfo newInfo) {
		myConstantPool[position-1]=newInfo;	
	}

	public ConstantPoolInfo get(int position) {
		return(	myConstantPool[position-1]);	
	}

	public int size() {
		return(myConstantPool.length);
	}

	@Override
	public void receive_Visitor(IVisitor visitor) {
		visitor.visit_ConstantPool(this);
	}
	
}
